<template>
	<view class="page-container">
		<view class="dataList padd30">
			<view class="li" v-for="(item,index) in dataList" :key="index" @click="toInfo(item)">
				<image class="bg" src="@/static/img/xqqw1.png"></image>
				<view class="name">{{item.name}}</view>
			</view>
		</view>
	</view>
</template>

<script setup>
	import {
		ref,
		getCurrentInstance,
	} from 'vue'
	import {
		onLoad,
		onShow,
		onShareAppMessage,
		onShareTimeline
	} from '@dcloudio/uni-app'
	const {
		proxy
	} = getCurrentInstance();

	const imagesUrl = proxy.$imagesUrl;//图片路径
	
	const dataList = ref([])

	

	
	function getUserActivity(){
		const user =  uni.getStorageSync('USERDATA');
		proxy.$request({
			url: `${proxy.$api.getUserActivity}`,
			method: "POST",
			data:{
				user_id:user.id
			}
		}).then(res => {
			dataList.value = dataList.value.concat(res.data);
		})
	}
	
	function toInfo(val){//跳转详细
		uni.setStorageSync('ENROLLDATA', val);
		uni.navigateTo({
			url:'/pages/enroll/info?id=' + val.id
		})
	}
	
	onLoad((e) => {
		getUserActivity()
	})
	
	onShow(() => {
	
	})
</script>

<style lang="less" scoped>
	.page-container {
		// padding-top: 158rpx;
		// height: 100vh;
	}

	
	.dataList{
		// background-color: #fff;
		.li{
			// padding: 15rpx;
			position: relative;
			margin-top: 30rpx;
			border-radius: 16rpx;
			box-shadow: 0px 0px 8px 0px rgba(55, 123, 245, 0.08);
			margin-bottom: 30rpx;
			height: 300rpx;
			// background: url(../../static/img/xqqw.png);
			.bg{
				width: 100%;
				height: 300rpx;
				border-radius: 16rpx;
			}
			.name{
				 position: absolute;
				  top: 50%;
				  left: 50%;
				  transform: translate(-50%, -50%);
				  //background: white;
				  padding: 20rpx 40rpx;
				  //border: solid 1rpx #bbb;
				  font-family: cursive;
				  font-size: 68rpx;
				  color: #ffbc00;
				  width: 500rpx;
				  text-align: center;
				  font-weight: bold;
			}
		}
	}
</style>